﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;
using System.Configuration;

namespace DataAccess
{
    /// <summary>
    /// 通用上下文
    /// </summary>
    public partial class NewDataContext : DataContext
    {
        private static MappingSource mappingSource = new AttributeMappingSource();

        #region Extensibility Method Definitions
        partial void OnCreated();
        #endregion

        public NewDataContext() :
            base(ConfigurationSettings.AppSettings["ConnStr"], mappingSource)
        {
            OnCreated();
        }

        public NewDataContext(string connection) :
            base(connection, mappingSource)
        {
            OnCreated();
        }

        public NewDataContext(System.Data.IDbConnection connection) :
            base(connection, mappingSource)
        {
            OnCreated();
        }

        public NewDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
            base(connection, mappingSource)
        {
            OnCreated();
        }

        public NewDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
            base(connection, mappingSource)
        {
            OnCreated();
        }

    }
}
